3.5.37 \(\int \tan (c+d x) (a+b \tan (c+d x))^3 \, dx\) [437]

Optimal. Leaf size=97 \[ -b \left (3 a^2-b^2\right ) x-\frac {a \left (a^2-3 b^2\right ) \log (\cos (c+d x))}{d}+\frac {b \left (a^2-b^2\right ) \tan (c+d x)}{d}+\frac {a (a+b \tan (c+d x))^2}{2 d}+\frac {(a+b \tan (c+d x))^3}{3 d} \]

[Out]

-b*(3*a^2-b^2)*x-a*(a^2-3*b^2)*ln(cos(d*x+c))/d+b*(a^2-b^2)*tan(d*x+c)/d+1/2*a*(a+b*tan(d*x+c))^2/d+1/3*(a+b*t
an(d*x+c))^3/d

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 97, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3609, 3606, 3556} \begin {gather*} \frac {b \left (a^2-b^2\right ) \tan (c+d x)}{d}-\frac {a \left (a^2-3 b^2\right ) \log (\cos (c+d x))}{d}-b x \left (3 a^2-b^2\right )+\frac {(a+b \tan (c+d x))^3}{3 d}+\frac {a (a+b \tan (c+d x))^2}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]*(a + b*Tan[c + d*x])^3,x]

[Out]

-(b*(3*a^2 - b^2)*x) - (a*(a^2 - 3*b^2)*Log[Cos[c + d*x]])/d + (b*(a^2 - b^2)*Tan[c + d*x])/d + (a*(a + b*Tan[
c + d*x])^2)/(2*d) + (a + b*Tan[c + d*x])^3/(3*d)

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3606

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[b*d*(Tan[e + f*x]/f), x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rubi steps

\begin {align*} \int \tan (c+d x) (a+b \tan (c+d x))^3 \, dx &=\frac {(a+b \tan (c+d x))^3}{3 d}+\int (-b+a \tan (c+d x)) (a+b \tan (c+d x))^2 \, dx\\ &=\frac {a (a+b \tan (c+d x))^2}{2 d}+\frac {(a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x)) \left (-2 a b+\left (a^2-b^2\right ) \tan (c+d x)\right ) \, dx\\ &=-b \left (3 a^2-b^2\right ) x+\frac {b \left (a^2-b^2\right ) \tan (c+d x)}{d}+\frac {a (a+b \tan (c+d x))^2}{2 d}+\frac {(a+b \tan (c+d x))^3}{3 d}+\left (a \left (a^2-3 b^2\right )\right ) \int \tan (c+d x) \, dx\\ &=-b \left (3 a^2-b^2\right ) x-\frac {a \left (a^2-3 b^2\right ) \log (\cos (c+d x))}{d}+\frac {b \left (a^2-b^2\right ) \tan (c+d x)}{d}+\frac {a (a+b \tan (c+d x))^2}{2 d}+\frac {(a+b \tan (c+d x))^3}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.58, size = 100, normalized size = 1.03 \begin {gather*} \frac {3 \left ((a+i b)^3 \log (i-\tan (c+d x))+(a-i b)^3 \log (i+\tan (c+d x))\right )-6 b \left (-3 a^2+b^2\right ) \tan (c+d x)+9 a b^2 \tan ^2(c+d x)+2 b^3 \tan ^3(c+d x)}{6 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]*(a + b*Tan[c + d*x])^3,x]

[Out]

(3*((a + I*b)^3*Log[I - Tan[c + d*x]] + (a - I*b)^3*Log[I + Tan[c + d*x]]) - 6*b*(-3*a^2 + b^2)*Tan[c + d*x] +
 9*a*b^2*Tan[c + d*x]^2 + 2*b^3*Tan[c + d*x]^3)/(6*d)

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 97, normalized size = 1.00

method result size
norman \(\left (-3 a^{2} b +b^{3}\right ) x +\frac {b \left (3 a^{2}-b^{2}\right ) \tan \left (d x +c \right )}{d}+\frac {b^{3} \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}+\frac {3 b^{2} a \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {a \left (a^{2}-3 b^{2}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) \(95\)
derivativedivides \(\frac {\frac {b^{3} \left (\tan ^{3}\left (d x +c \right )\right )}{3}+\frac {3 b^{2} a \left (\tan ^{2}\left (d x +c \right )\right )}{2}+3 a^{2} b \tan \left (d x +c \right )-b^{3} \tan \left (d x +c \right )+\frac {\left (a^{3}-3 b^{2} a \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (-3 a^{2} b +b^{3}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(97\)
default \(\frac {\frac {b^{3} \left (\tan ^{3}\left (d x +c \right )\right )}{3}+\frac {3 b^{2} a \left (\tan ^{2}\left (d x +c \right )\right )}{2}+3 a^{2} b \tan \left (d x +c \right )-b^{3} \tan \left (d x +c \right )+\frac {\left (a^{3}-3 b^{2} a \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (-3 a^{2} b +b^{3}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(97\)
risch \(-3 a^{2} b x +b^{3} x +i a^{3} x -3 i a \,b^{2} x +\frac {2 i a^{3} c}{d}-\frac {6 i a \,b^{2} c}{d}-\frac {2 i b \left (9 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-9 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+6 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+9 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-18 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+6 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-9 a^{2}+4 b^{2}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}-\frac {a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}+\frac {3 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) b^{2}}{d}\) \(206\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)*(a+b*tan(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(1/3*b^3*tan(d*x+c)^3+3/2*b^2*a*tan(d*x+c)^2+3*a^2*b*tan(d*x+c)-b^3*tan(d*x+c)+1/2*(a^3-3*a*b^2)*ln(1+tan(
d*x+c)^2)+(-3*a^2*b+b^3)*arctan(tan(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.52, size = 95, normalized size = 0.98 \begin {gather*} \frac {2 \, b^{3} \tan \left (d x + c\right )^{3} + 9 \, a b^{2} \tan \left (d x + c\right )^{2} - 6 \, {\left (3 \, a^{2} b - b^{3}\right )} {\left (d x + c\right )} + 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 6 \, {\left (3 \, a^{2} b - b^{3}\right )} \tan \left (d x + c\right )}{6 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

1/6*(2*b^3*tan(d*x + c)^3 + 9*a*b^2*tan(d*x + c)^2 - 6*(3*a^2*b - b^3)*(d*x + c) + 3*(a^3 - 3*a*b^2)*log(tan(d
*x + c)^2 + 1) + 6*(3*a^2*b - b^3)*tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 1.41, size = 94, normalized size = 0.97 \begin {gather*} \frac {2 \, b^{3} \tan \left (d x + c\right )^{3} + 9 \, a b^{2} \tan \left (d x + c\right )^{2} - 6 \, {\left (3 \, a^{2} b - b^{3}\right )} d x - 3 \, {\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 6 \, {\left (3 \, a^{2} b - b^{3}\right )} \tan \left (d x + c\right )}{6 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

1/6*(2*b^3*tan(d*x + c)^3 + 9*a*b^2*tan(d*x + c)^2 - 6*(3*a^2*b - b^3)*d*x - 3*(a^3 - 3*a*b^2)*log(1/(tan(d*x
+ c)^2 + 1)) + 6*(3*a^2*b - b^3)*tan(d*x + c))/d

________________________________________________________________________________________

Sympy [A]
time = 0.11, size = 128, normalized size = 1.32 \begin {gather*} \begin {cases} \frac {a^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - 3 a^{2} b x + \frac {3 a^{2} b \tan {\left (c + d x \right )}}{d} - \frac {3 a b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {3 a b^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} + b^{3} x + \frac {b^{3} \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac {b^{3} \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan {\left (c \right )}\right )^{3} \tan {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))**3,x)

[Out]

Piecewise((a**3*log(tan(c + d*x)**2 + 1)/(2*d) - 3*a**2*b*x + 3*a**2*b*tan(c + d*x)/d - 3*a*b**2*log(tan(c + d
*x)**2 + 1)/(2*d) + 3*a*b**2*tan(c + d*x)**2/(2*d) + b**3*x + b**3*tan(c + d*x)**3/(3*d) - b**3*tan(c + d*x)/d
, Ne(d, 0)), (x*(a + b*tan(c))**3*tan(c), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 993 vs. \(2 (93) = 186\).
time = 1.32, size = 993, normalized size = 10.24 \begin {gather*} -\frac {18 \, a^{2} b d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 6 \, b^{3} d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + 3 \, a^{3} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 9 \, a b^{2} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 54 \, a^{2} b d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 18 \, b^{3} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 9 \, a b^{2} \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 9 \, a^{3} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 27 \, a b^{2} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 18 \, a^{2} b \tan \left (d x\right )^{3} \tan \left (c\right )^{2} - 6 \, b^{3} \tan \left (d x\right )^{3} \tan \left (c\right )^{2} + 18 \, a^{2} b \tan \left (d x\right )^{2} \tan \left (c\right )^{3} - 6 \, b^{3} \tan \left (d x\right )^{2} \tan \left (c\right )^{3} + 54 \, a^{2} b d x \tan \left (d x\right ) \tan \left (c\right ) - 18 \, b^{3} d x \tan \left (d x\right ) \tan \left (c\right ) - 9 \, a b^{2} \tan \left (d x\right )^{3} \tan \left (c\right ) + 9 \, a b^{2} \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 9 \, a b^{2} \tan \left (d x\right ) \tan \left (c\right )^{3} + 2 \, b^{3} \tan \left (d x\right )^{3} + 9 \, a^{3} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) - 27 \, a b^{2} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) - 36 \, a^{2} b \tan \left (d x\right )^{2} \tan \left (c\right ) + 18 \, b^{3} \tan \left (d x\right )^{2} \tan \left (c\right ) - 36 \, a^{2} b \tan \left (d x\right ) \tan \left (c\right )^{2} + 18 \, b^{3} \tan \left (d x\right ) \tan \left (c\right )^{2} + 2 \, b^{3} \tan \left (c\right )^{3} - 18 \, a^{2} b d x + 6 \, b^{3} d x + 9 \, a b^{2} \tan \left (d x\right )^{2} - 9 \, a b^{2} \tan \left (d x\right ) \tan \left (c\right ) + 9 \, a b^{2} \tan \left (c\right )^{2} - 3 \, a^{3} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) + 9 \, a b^{2} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (c\right )^{2} + 1}\right ) + 18 \, a^{2} b \tan \left (d x\right ) - 6 \, b^{3} \tan \left (d x\right ) + 18 \, a^{2} b \tan \left (c\right ) - 6 \, b^{3} \tan \left (c\right ) + 9 \, a b^{2}}{6 \, {\left (d \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 3 \, d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 3 \, d \tan \left (d x\right ) \tan \left (c\right ) - d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)*(a+b*tan(d*x+c))^3,x, algorithm="giac")

[Out]

-1/6*(18*a^2*b*d*x*tan(d*x)^3*tan(c)^3 - 6*b^3*d*x*tan(d*x)^3*tan(c)^3 + 3*a^3*log(4*(tan(d*x)^4*tan(c)^2 - 2*
tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(d*x)^3*tan(c
)^3 - 9*a*b^2*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)
*tan(c) + 1)/(tan(c)^2 + 1))*tan(d*x)^3*tan(c)^3 - 54*a^2*b*d*x*tan(d*x)^2*tan(c)^2 + 18*b^3*d*x*tan(d*x)^2*ta
n(c)^2 - 9*a*b^2*tan(d*x)^3*tan(c)^3 - 9*a^3*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan
(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(d*x)^2*tan(c)^2 + 27*a*b^2*log(4*(tan(d*x)^4*t
an(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(
d*x)^2*tan(c)^2 + 18*a^2*b*tan(d*x)^3*tan(c)^2 - 6*b^3*tan(d*x)^3*tan(c)^2 + 18*a^2*b*tan(d*x)^2*tan(c)^3 - 6*
b^3*tan(d*x)^2*tan(c)^3 + 54*a^2*b*d*x*tan(d*x)*tan(c) - 18*b^3*d*x*tan(d*x)*tan(c) - 9*a*b^2*tan(d*x)^3*tan(c
) + 9*a*b^2*tan(d*x)^2*tan(c)^2 - 9*a*b^2*tan(d*x)*tan(c)^3 + 2*b^3*tan(d*x)^3 + 9*a^3*log(4*(tan(d*x)^4*tan(c
)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(d*x)
*tan(c) - 27*a*b^2*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan
(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(d*x)*tan(c) - 36*a^2*b*tan(d*x)^2*tan(c) + 18*b^3*tan(d*x)^2*tan(c) - 36
*a^2*b*tan(d*x)*tan(c)^2 + 18*b^3*tan(d*x)*tan(c)^2 + 2*b^3*tan(c)^3 - 18*a^2*b*d*x + 6*b^3*d*x + 9*a*b^2*tan(
d*x)^2 - 9*a*b^2*tan(d*x)*tan(c) + 9*a*b^2*tan(c)^2 - 3*a^3*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) +
 tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1)) + 9*a*b^2*log(4*(tan(d*x)^4*tan(c)^
2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1)) + 18*a^2*b
*tan(d*x) - 6*b^3*tan(d*x) + 18*a^2*b*tan(c) - 6*b^3*tan(c) + 9*a*b^2)/(d*tan(d*x)^3*tan(c)^3 - 3*d*tan(d*x)^2
*tan(c)^2 + 3*d*tan(d*x)*tan(c) - d)

________________________________________________________________________________________

Mupad [B]
time = 3.83, size = 135, normalized size = 1.39 \begin {gather*} \frac {\mathrm {tan}\left (c+d\,x\right )\,\left (3\,a^2\,b-b^3\right )}{d}+\frac {b^3\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,d}-\frac {\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )\,\left (\frac {3\,a\,b^2}{2}-\frac {a^3}{2}\right )}{d}+\frac {3\,a\,b^2\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2\,d}-\frac {b\,\mathrm {atan}\left (\frac {b\,\mathrm {tan}\left (c+d\,x\right )\,\left (3\,a^2-b^2\right )}{3\,a^2\,b-b^3}\right )\,\left (3\,a^2-b^2\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)*(a + b*tan(c + d*x))^3,x)

[Out]

(tan(c + d*x)*(3*a^2*b - b^3))/d + (b^3*tan(c + d*x)^3)/(3*d) - (log(tan(c + d*x)^2 + 1)*((3*a*b^2)/2 - a^3/2)
)/d + (3*a*b^2*tan(c + d*x)^2)/(2*d) - (b*atan((b*tan(c + d*x)*(3*a^2 - b^2))/(3*a^2*b - b^3))*(3*a^2 - b^2))/
d

________________________________________________________________________________________